import yaml

from common.tools import get_project_path, sep


class GetConf:
    def __init__(self):
        with open(get_project_path() + sep(["config", "environment.yaml"], add_sep_before=True), "r",
                  encoding="utf-8") as env_file:
            self.env = yaml.load(env_file, Loader=yaml.FullLoader)

    def get_user_profile(self, user):
        return self.env["user"][user]["username"], self.env["user"][user]["password"], self.env["user"][user]["enterprise"]

    def get_url(self):
        return self.env["url"]
